package configs

import (
	"github.com/go-sql-driver/mysql"
	"time"
)

// 本文件建议在代码协同工具(git/svn等)中忽略

var env = Env{
	DEBUG:       true,
	SERVER_PORT: "8081",
	DATABASE: mysql.Config{
		User:                 "root",
		Passwd:               "",
		Addr:                 "127.0.0.1:3306",
		DBName:               "test",
		Collation:            "utf8mb4_unicode_ci",
		Net:                  "tcp",
		AllowNativePasswords: true,
	},
	MAXIDLECONNS:         50,
	MAXOPENCONNS:         100,
	REDIS_IP:             "127.0.0.1",
	REDIS_PORT:           "6379",
	REDIS_PASSWORD:       "",
	REDIS_DB:             0,
	REDIS_SESSION_DB:     1,
	REDIS_CACHE_DB:       2,
	ROUTER_LOG_PATH:      routerLogPath(),
	ACCESS_LOG:           true,
	ACCESS_LOG_PATH:      "D:\\Project\\Go\\log\\mygin\\access.log",
	ERROR_LOG:            true,
	ERROR_LOG_PATH:       "D:\\Project\\Go\\log\\mygin\\access.log",
	INFO_LOG:             true,
	INFO_LOG_PATH:        "D:\\Project\\Go\\log\\mygin\\access.log",
	TEMPLATE_PATH:        "frontend/templates",
	STATIC_URL:           "/static",
	STATIC_RESOURCE_PATH: "./frontend",
	//APP_SECRET: 			"YbskZqLNT6TEVLUA9HWdnHmZErypNJpL",
	APP_SECRET: "something-very-secret",
}

func routerLogPath() string {
	return "D:\\Project\\Go\\log\\mygin(" + time.Unix(time.Now().Unix(), 0).Format("2006-01-02") + ").log"
}
